<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/jquery2.1.4.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
	<table class="${tableclass}" style="width: 100%">
	   <tr><th><strong class="am-text-primary am-text-lg"> 项目管理</strong> /  模块管理 - ${project.name}
	    	</th></tr>
	</table>    
  <div style="margin-left: 0.5rem">
    <div class="seller_list_title">
        <ul class="seller_title_ul am-tabs-nav am-nav am-nav-tabs">
            <li><i></i><a href="<ls:url address="/admin/project/load/${project.id}"/>">项目信息</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectPlan/query/${project.id}"/>">里程碑</a></li>
            <li><i></i><a href="<ls:url address="/admin/task/query/${project.id}"/>">目标</a></li>
            <li class="am-active"><i></i><a href="<ls:url address="/admin/projectModule/query/${project.id}"/>">模块</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectMember/query/${project.id}"/>">团队</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectReport/query/${project.id}"/>">报表</a></li>
        </ul>
    </div>
</div>  
    
    <form action="<ls:url address='/admin/projectModule/query/${projectId}'/>" id="form1" method="post">
        <table class="${tableclass}" style="width: 100%">
		    <tbody><tr><td>
		    	    <div align="left" style="padding: 3px">
				       	    <input type="hidden" id="curPage" name="curPage" value="${curPageNO}" />
				            	&nbsp;模块名称:
				            	<input type="text" name="name" maxlength="50" value="${name}" />
				            <input type="submit" value="搜索"/>
				            <input type="button" value="添加" onclick='javascript:updateProjectModule(this)'/>
						     <input type="button" value="批量添加" onclick='javascript:updateBatchProjectModule(this)'/>
				      </div>
		     </td></tr></tbody>
	    </table>
    </form>
         <div align="center"> 
          <%@ include file="/WEB-INF/pages/common/messages.jsp"%>
		<display:table name="list" requestURI="/admin/projectModule/query" id="item" export="false" sort="external" class="${tableclass}" style="width:100%">
     		<display:column title="模块名字" property="name"></display:column>
     		<display:column title="已用工时"></display:column>
     		<display:column title="建立时间"><fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd HH:mm" /></display:column>
	      
	     <display:column title="操作" media="html" style="width:235px">
	      	<div class="am-btn-toolbar">
			  <div class="am-btn-group am-btn-group-xs">
					<button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="javascript:editProjectModule(this,'${item.id}')"><span class="am-icon-pencil-square-o"></span> 修改</button>
					<button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick="deleteById('${item.id}')" ><span class="am-icon-trash-o"></span> 删除</button>
			  </div>
			</div>
	      </display:column>
	      
	      
	    </display:table>
	       <ls:page pageSize="${pageSize }"  total="${total}" curPageNO="${curPageNO }"  type="default"/> 
	    </div>
     
        <script language="JavaScript" type="text/javascript">
			   function deleteById(id) {
			      if(confirm("  确定删除 ?")){
			            window.location = "<ls:url address='/admin/projectModule/delete/" + id + "'/>";
			        }
			    }
			
			   function pager(curPageNO){
			            document.getElementById("curPage").value=curPageNO;
			            document.getElementById("form1").submit();
			        }
			        
			   	 //新增产品模块
			    function updateProjectModule(obj, projectModuleId){
			    		var page = contextPath + "/admin/projectModule/loadByProject/${project.id}";
			    		layer.open({
				    		  type: 2,
				    		  id: "updateProjectModule",
				    		  title: "新增项目模块",
				    		  area: ['450px','300px'],
				    		  content: page //iframe的url，no代表不显示滚动条
				    		});
			    	}

			   //批量新增产品模块
			   function updateBatchProjectModule(obj, projectModuleId){
				   var page = contextPath + "/admin/projectModule/loadBatchByProject/${project.id}";
				   layer.open({
					   type: 2,
					   id: "updateBatchProjectModule",
					   title: "批量新增项目模块",
					   area: ['450px','600px'],
					   content: page //iframe的url，no代表不显示滚动条
				   });
			   }
			   	 
			   	 //修改产品模块
			    function editProjectModule(obj, projectModuleId){
			    		var page = contextPath + "/admin/projectModule/load/" + projectModuleId;
			    		layer.open({
				    		  type: 2,
				    		  id: "updateProjectModule",
				    		  title: "编辑项目模块",
				    		  area: ['450px','300px'],
				    		  content: page //iframe的url，no代表不显示滚动条
				    		});
			    	}
		</script>


